Pixel cache: Add no-pixel-cache debug flag
authorAlexander Larsson <alexl@redhat.com>
Mon, 9 Sep 2013 09:07:50 +0000 (11:07 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 9 Sep 2013 09:07:50 +0000 (11:07 +0200)
This is useful for benchmarking comparisons, and to verify if bugs
happend with or without the pixel cache.

gtk/gtkdebug.h
gtk/gtkmain.c
gtk/gtkpixelcache.c

index d98c1974a0333ad49462f7abfe102749a8bb148c..a91e6da636c62991b715285625a78f3ca56acc70 100644 (file)
@@ -50,7 +50,8 @@ typedef enum {
   GTK_DEBUG_SIZE_REQUEST    = 1 << 12,
   GTK_DEBUG_NO_CSS_CACHE    = 1 << 13,
   GTK_DEBUG_BASELINES       = 1 << 14,
-  GTK_DEBUG_PIXEL_CACHE     = 1 << 15
+  GTK_DEBUG_PIXEL_CACHE     = 1 << 15,
+  GTK_DEBUG_NO_PIXEL_CACHE  = 1 << 16
 } GtkDebugFlag;
 
 #ifdef G_ENABLE_DEBUG
index 4d814a9ea87c541ff8a1cfb4f2be91de950e8dcf..285d181a73fcfb4a16267be473294b2adcca70e2 100644 (file)
@@ -173,7 +173,8 @@ static const GDebugKey gtk_debug_keys[] = {
   {"size-request", GTK_DEBUG_SIZE_REQUEST},
   {"no-css-cache", GTK_DEBUG_NO_CSS_CACHE},
   {"baselines", GTK_DEBUG_BASELINES},
-  {"pixel-cache", GTK_DEBUG_PIXEL_CACHE}
+  {"pixel-cache", GTK_DEBUG_PIXEL_CACHE},
+  {"no-pixel-cache", GTK_DEBUG_NO_PIXEL_CACHE}
 };
 #endif /* G_ENABLE_DEBUG */
 
index 2529f1184552c137e3c9f2fc8bf167a0dc4037eb..ca6740f64155e881a33540fb5a0c4a2f09d1ff7c 100644 (file)
@@ -174,6 +174,11 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache         *cache,
   cairo_pattern_t *bg;
   double red, green, blue, alpha;
 
+#ifdef G_ENABLE_DEBUG
+  if (gtk_get_debug_flags () & GTK_DEBUG_NO_PIXEL_CACHE)
+    return;
+#endif
+
   content = cache->content;
   if (!content)
     {